package com.tonghaibo.config;

import org.springframework.web.servlet.support.AbstractAnnotationConfigDispatcherServletInitializer;


/**
 * @author jitwxs
 * @date 2025年04月27日 21:00
 */
//ServletConfig配置类，加载SpringMvcConfig和SpringConfig配置类
public class ServletConfig extends AbstractAnnotationConfigDispatcherServletInitializer {
    //配置spring容器
    @Override
    protected Class<?>[] getRootConfigClasses() {
        return new Class[]{SpringConfig.class};
    }
    //配置springmvc容器
    @Override
    protected Class<?>[] getServletConfigClasses() {
        return new Class[]{SpringMvcConfig.class};
    }

    //配置访问路径
    @Override
    protected String[] getServletMappings() {
        return new String[]{"/"};
    }
}
